package com.cbwl.eoas.web.controller.appint;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.cbwl.eoas.cms.api.eoas.IAppMessageInfoService;
import com.cbwl.eoas.cms.model.eoas.AppMessageInfoDTO;
import com.cbwl.eoas.common.framework.vo.PageRequest;
import com.cbwl.eoas.common.web.Result;



/**
 * 
 * <p>[描述信息：注释]</p>
 *
 * @author 虞云波 - yuyunbo@3856.cc
 * @version 1.0 Created on 2017年10月12日 下午13:29:23
 */
@RestController
@RequestMapping("/v1/msi")
public class AppMessageInfoController {
	
	//业务层注解
	@Autowired
	private IAppMessageInfoService appMessageInfoService;

	
	
	/**
	 * <p>查询（分页）</p>
	 * 
	 * @param bean
	 * @return
	 * @author 虞云波 - yuyunbo@3856.cc
	 * @version 1.0 Created on 2017年10月12日 下午13:29:23
	 */
	@RequestMapping(value="/queryAppMessageInfoPage",method = RequestMethod.POST)
	public Object queryAppMessageInfoPage(HttpServletRequest request,PageRequest pageRequest,AppMessageInfoDTO bean) {
		Result result = new Result(Result.Status.OK, "查询成功", "200");
		// 分页查询用户信息
		List<AppMessageInfoDTO> list =  appMessageInfoService.queryAppMessageList(pageRequest);
		result.setData(list);
		return result;
	}
	

	/**
	 * 
	 * <p>通过id查询主体信息</p>
	 * 
	 * @param bean
	 * @return
	 * @author 虞云波 - yuyunbo@3856.cc
	 * @version 1.0 Created on 2017年10月12日 下午13:29:23
	 */
	@RequestMapping(value="/getInfoById",method = RequestMethod.POST)
	public Object getAppMessageInfoById(HttpServletRequest request,AppMessageInfoDTO bean) {
		Result result = new Result(Result.Status.OK, "查询成功", "200");
		result.setData(appMessageInfoService.getObjectById(bean));
		return result;
	}

	
}
